home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 August / August CD.bin / Shareware / Education / numericalmethods Folder / chap_4 / zsinde.m < prev    next >
Encoding:
Text File  |  1994-06-05  |  1.0 KB  |  53 lines  |  [MATF/MATL]

  1. function [fun,dfun,ifun,x0,m,C,Ax] = zsinde
  2. % Taylor series coefficient lists for several functions.
  3. % Pm(x) = c(1) + c(2)x + c(2)x^2 + ... + c(m+1)x^m
  4. % fun  is the function, output.
  5. % dfun is the derivative, output.
  6. % ifun is the integral, output.
  7. % x0 is the point of expansion, output.
  8. % m  is the degree of the polynomial, output.
  9. % C  is the coefficient list, output.
  10. % Ax contains three asis vectors plotting, output.
  11. x0 = 0; 
  12. m = 25;
  13. a = 0;
  14. b = 2*pi;
  15. ymin = -0.05;
  16. ymax = 0.4;
  17. ymin1 = -0.3;
  18. ymax1 = 1;
  19. ymin2 = 0;
  20. ymax2 = 0.6;
  21. Ax(1,:) = [a b ymin ymax];
  22. Ax(2,:) = [a b ymin1 ymax1];
  23. Ax(3,:) = [a b ymin2 ymax2];
  24. fun = 'sin(x)./exp(x)';
  25. dfun = 'cos(x)./exp(x) - sin(x)./exp(x)';
  26. ifun = '1/2-cos(x)./(2.*exp(x)) - sin(x)./(2.*exp(x))';
  27. C = [1/3786916514485104000000,
  28. 0,
  29. -1/12623055048283680000,
  30. 1/548828480360160000,
  31. -1/49893498214560000,
  32. 0,
  33. 1/237588086736000,
  34. -1/12504636144000,
  35. 1/1389404016000,
  36. 0,
  37. -1/10216206000,
  38. 1/681080400,
  39. -1/97297200,
  40. 0,
  41. 1/1247400,
  42. -1/113400,
  43. 1/22680,
  44. 0,
  45. -1/630,
  46. 1/90,
  47. -1/30,
  48. 0,
  49. 1/3,
  50. -1,
  51. 1,
  52. 0];
  53.